<?php if (!defined('THINK_PATH')) exit();?><!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
	<title>试卷添加</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
	<script type="text/javascript" src="__JS__/jQuery/jquery.js"></script>
    <script type="text/javascript" src="__JS__/jQuery/jquery.form.js"></script>
	<script type="text/JavaScript">
       $(function(){
           $('#form1').ajaxForm({
               //beforeSubmit:  function(){alert("before");},  // pre-submit callback
               success:       complete,  // post-submit callback
               error:function(){alert("error");},
               dataType: 'json'
           });
           
           function complete(data){
               if (data.status==1)
               {
            	   window.location='__URL__/testdetail';
               }else{
                   $('#result').html(data.test).show();
               }
           }
       });
	</script>		
</head>
<body>
<body>
	 <!-- layout::Auth:header::0 -->
     	<div class="container-fluid">
     			<div class="row-fluid">
     				<!-- layout::Auth:leftmenu::0 -->
                    <div class="span8">
                          <div class="hero-unit">
                            <h1>试卷添加</h1>
                            <p style="font-size:12px">当前位置：
                                <a href='__APP__/index/index'>主页</a>>
                                <a href='__URL__/index' >后台管理</a>>
                                <a href='__URL__/testdetail'>试题管理</a>>
                                <a href="__URL__/textadd">试题添加</a>
                             </p>
                          </div>
						  <div id='result'></div>	
						  <form id='form1' method="post" action="__URL__/testadd_post" >
                            <input type='hidden' name='no' value='<?php echo ($no); ?>'>
                           
                               <input type="text" name="name" class="input-xxlarge disable" placeholder=" 试卷名">
                               <br>
                               <code>所属课程</code> <select name="courseid">
                                		<option></option>
                                    <?php if(is_array($clist)): $i = 0; $__LIST__ = $clist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><option value =	<?php echo ($vo["courseid"]); ?>><?php echo ($vo["cname"]); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                                <br>
                           		<code>试卷类型</code><select name="type">
                                	<option></option>
                                    <?php if(is_array($typelist)): $i = 0; $__LIST__ = $typelist;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): ++$i;$mod = ($i % 2 )?><option value =	<?php echo ($vo); ?>><?php echo ($vo); ?></option><?php endforeach; endif; else: echo "" ;endif; ?>
                                </select>
                           		<br>
                                <input type="submit" value="组卷" style="width:80px" class="btn btn-success" >            
                        </form>
		
			</div>
          </div>
        </div>
</body>
</html>